package com.feicheng.service;

import com.feicheng.base.result.Result;
import com.feicheng.entity.IntoHeader;
import com.feicheng.entity.Product;
import com.feicheng.entity.Warehouse;
import com.feicheng.model.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("PROVIDERWAREHOUSE")
public interface ProviderWarehouseController {

    @PostMapping("/product/a")
    Result getProductName(@RequestBody WarehouseWithStore wareHouse);

    @PostMapping("/into/info")
    public IntoHeader selecttest(@RequestParam Integer intoHeaderId);

    /**
     * 选择商品类别下拉框的伪装接口
     * @author wei.zhang
     * @return
     */
    @PostMapping("/product/type/list/g")
    public Result selectProduct();

    /**
     * 选择商品下拉框的伪装接口
     * @author zhennan.liu
     * @param productAndUser
     * @return
     */
    @PostMapping("/product/product_name/list/g")
    public Result getall(@RequestBody ProductAndUser productAndUser);



    /**
     * 调用消费者仓库列表条件分页接口的伪装接口
     * @author lu.yu
     * @param current
     * @param size
     * @param userAndWarehouse
     * @return
     */
    @PostMapping("/warehouse/page/g")
    public Result selectByPage(@RequestParam(defaultValue = "1") Integer current,
                               @RequestParam(defaultValue = "10") Integer size,
                               @RequestBody UserAndWarehouse userAndWarehouse);

    /**
     * 新增仓库接口
     * @param warehouseWithStore 仓库信息
     * @author zhengnan.fu
     * @return
     */
    @PostMapping("warehouse/info")
    public Result addWarehouse(@RequestBody WarehouseWithStore warehouseWithStore);

    /**
     * 出库详情查询
     * @param outboundHeaderId
     * @return
     * @autor jing.zhou
     */
    @PostMapping("/outbound/detail/page/g")
    public Result outDetail (
            @RequestParam  Integer outboundHeaderId,
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size
    ) ;

    /**
     * 入库查询详情
     * @param current 当前页
     * @param size 每页条数
     * @param intoHeaderId 入库头ID
     * @author yvan.yao
     * @return
     * @since 2022-07-04
     */
    @PostMapping("/into/detail/page/g")
    public Result getIntoHeader(@RequestParam Integer intoHeaderId,
                                @RequestParam(defaultValue = "1") Integer current,
                                @RequestParam(defaultValue = "10") Integer size
    );
    /**
     * 新增入库接口
     * @param intoHeaderIntoItem 入库信息
     * @author guihai.yu
     * @return
     */
    @PostMapping("/into/info")
    public Result insertInto(@RequestBody IntoHeaderIntoItem intoHeaderIntoItem);

    /**
     * 出库列表条件分页查询
     * @param current 当前页
     * @param size 每页条数
     * @param outboundWithSaleWithWarehouse 出库信息
     * @author wei.zhang
     * @return
     */
    @PostMapping("/outbound/page/g")
    public Result getOutbound(
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size,
            OutboundWithSaleWithWarehouse outboundWithSaleWithWarehouse );

    /**
     * 新增出库接口
     * @param outboundHeaderWithItem 出库信息
     * @author siyu.liu
     * @return
     */
    @PostMapping("/outbound/info")
    public Result insertOutbound(@RequestBody OutboundHeaderWithItem outboundHeaderWithItem);

    /**
     * 仓库下拉查询
     *
     * @param storeId 门店编号
     * @author peiwen.song
     * @since 2022-07-05
     * @return
     */
    @PostMapping("/warehouse/info/all/g")
    Result selectWarehouse(@RequestParam Integer storeId);

    /**
     * 修改仓库信息接口
     * @param warehouseInfo 仓库信息
     * @author yu.xiu
     * @return
     */

    @PutMapping("/info")
    public Result updateinfo(@RequestBody WarehouseInfo warehouseInfo);


    /**
     * 根据仓库编号逻辑删除仓库信息伪装接口
     * @param warehouse 仓库信息
     * @author yue.guo
     * @return true/false
     */

    @DeleteMapping("/warehouse/info")
    public Result updateDflgByWarehouseId(@RequestBody Warehouse warehouse);

    /**
     * 库存列表条件分页查询接口
     * @param current 当前页
     * @param size 每页条数
     * @param stockAndProduct 出库信息
     * @author tao.jiang
     * @return
     */
    @PostMapping("/stock/page/g")
    public Result getstock(
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size,
            @RequestBody StockAndProduct stockAndProduct);

    /**
     * 仓库信息详细查询
     * @param warehouseId 仓库主键
     * @author bo.wei
     * @return
     */
    @PostMapping("/warehouse/info/g")
    public Result selectWarehouseOne(@RequestParam Integer warehouseId);
    /**
     * 管理员下拉查询
     * @autor wei.zhang
     * @param
     * @return
     */
    @PostMapping("/user/info/all/g")
    public Result getUserList(@RequestParam Integer storeId);
}

